<%--
  Created by IntelliJ IDEA.
  User: 姜正杰
  Date: 2019/12/14
  Time: 11:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录页面</title>
    <script>
        window.onload = function () {
            var img = document.getElementById("onclick_img");
            img.onclick = function () {
                var date = new Date();
                img.src = "/my_login/CheckCodeServlet?" + date.getTime();
            }
        }
    </script>
    <style>
        div {
            color: red;
        }
    </style>
</head>
<body>
<form action="/my_login/LoginServlet2" method="post">
    <table>
        <tr>
            <td>账户:</td>
            <td><input placeholder="请输入账户" type="text" name="username"></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input placeholder="请输入密码" type="password" name="password"></td>
        </tr>
        <tr>
            <td>验证码:</td>
            <td><input placeholder="请输入验证码" type="text" name="check_code"></td>
        </tr>
        <tr>
            <td colspan="2">
                <img src="/my_login/CheckCodeServlet" alt="" id="onclick_img">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="登录">
            </td>
        </tr>
    </table>
</form>
<div><%=request.getAttribute("cc_error") == null ? "" : request.getAttribute("cc_error")%>
</div>
<div><%=request.getAttribute("login_user") == null ? "" : request.getAttribute("login_user")%>
</div>
</body>
</html>
